package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class UniqueConstraintDefinition implements TableConstraint {
    
    private int beginIndex;
    private int endIndex;
    private UniqueSpecification uniqueSpecification;
    private IdentifierList uniqueColumnList;

    public UniqueConstraintDefinition(int beginIndex,
                                      int endIndex,
                                      UniqueSpecification uniqueSpecification,
                                      IdentifierList uniqueColumnList) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.uniqueSpecification = uniqueSpecification;
        this.uniqueColumnList = uniqueColumnList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public UniqueSpecification getUniqueSpecification() {
        return uniqueSpecification;
    }

    public IdentifierList getUniqueColumnList() {
        return uniqueColumnList;
    }

    public boolean isValue() {
        return uniqueColumnList == null || uniqueColumnList.isEmpty();
    }

}
